﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BHXJDOTNET;
using BHXJDOTNET.NEW;
using BHXJDOTNET.OLD;
using System.Drawing.Drawing2D;

namespace 测试窗体
{
    public partial class UserControl2 : BHXJContainer
    {
        public UserControl2()
        {
            InitializeComponent();
           
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            //base.OnPaint(e);
            Graphics g = e.Graphics;
            g.SmoothingMode = SmoothingMode.AntiAlias;
            {
                Pen p = new Pen(Color.Black, 15);
                //p.DashStyle = DashStyle.Dash;

                g.DrawLine(p, 0, 50, 300, 300);
            }

            GraphicsPath gp = new GraphicsPath();
            
            //gp.AddLine(0, 0, 100, 100);
            //gp.AddLine(100, 100, 0, 100);
            gp.AddArc(new RectangleF(0, 0, 299, 299), 0, 360);

            //Region A = new Region(gp);
            //Region B = new Region(new RectangleF(0, 0, 300, 300));

            //A.Xor(B);
            //this.Region = A;
            g.SetClip(gp);
            

            {
                Pen p = new Pen(Color.FromArgb(150, 255, 255, 255), 9);
                p.DashStyle = DashStyle.Dash;
                p.DashOffset = 15;
                p.DashPattern = new float[] { 1.5f, 0.4f };
                g.DrawLine(p, 0, 50, 300, 300);
            }


        }
    }
}
